import request from "@/utils/request";

export const getListAPi = (params?: any) => {
  return request({
    url: "/staff/list",
    method: "get",
    params,
  });
};

export const staffOptionApi = () => {
  return request({
    url: "/staff/options",
    method: "get",
  });
};

export const addLeaveApi = (data: any) => {
  return request({
    url: "/staff/leave",
    method: "post",
    data,
  });
};

export const getLeaveApi = (id: number) => {
  return request({
    url: "/staff/leave/"+id,
    method: "get",
  });
};

export const getFormApi = (id: number) => {
  return request({
    url: "/staff/" + id,
    method: "get",
  });
};

export const saveApi = (data: any) => {
  return request({
    url: "/staff/save",
    method: "post",
    data,
  });
};

export const delApi = (id: number) => {
  return request({
    url: "/staff/delete/" + id,
    method: "delete",
  });
};

export const fileListApi = (id: number) => {
  return request({
    url: "/staff/files/" + id,
    method: "get",
  });
};

export const fileSaveApi = (data: any) => {
  return request({
    url: "/staff/file/save",
    method: "post",
    data,
  });
};

export const fileDelApi = (id: number) => {
  return request({
    url: "/staff/file/" + id,
    method: "delete",
  });
};

export const fileTypeApi = () => {
  return request({
    url: "/staff/file/type",
    method: "get",
  });
};
